//导入
import Router from './director.js';
import Reg from '../pages/reg.js';
import Login from '../pages/login.js';
import Manage from '../pages/manage.js';
import userManage from '../pages/usermanage.js';
import Infos from '../pages/infos.js';
import Cinema from '../pages/cinema.js';
import FilmsManage from '../pages/filmsManage.js';
import Soons from '../pages/soons.js';
import HotShow from '../pages/hotShow.js';
import HotPlay from '../pages/hotPlay.js';
let { $ } = layui;
let routes = {
    '/reg': new Reg(),
    '/login': new Login(),
    '/manage': {
        '/usermanage': () => new userManage(),
        '/infos': () => new Infos(),
        '/cinema': () => new Cinema(),
        '/filmsManage': () => new FilmsManage(),
        '/soons': () => new Soons(),
        '/hotShow': () => new HotShow(),
        '/hotPlay': () => new HotPlay(),
        on: (next) => new Manage(next)
    }
};

// 默认访问注册模块
location.hash = location.hash || "#login";
let router = Router(routes).configure({
    recurse: 'forward',
    async: true,
    strict: false
}); // 实例化路由
router.init(); // 初始化路由
